package Text10;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int p=scanner.nextInt();
        int q=scanner.nextInt();
        System.out.println((p-1)*(q-1)-1);
    }
}
